.nav-bar {
    background-color: #333;
    padding: 1rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
}

.nav-menu a:hover, .nav-menu a.active {
    background-color: #4CAF50;
    border-radius: 4px;
}

.product-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.product-card h3 {
    margin: 0;
    min-width: 200px;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.product-card .price {
    color: #e44d26;
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 120px;
    margin: 0;
}

.product-card .stock {
    color: #666;
    font-size: 0.9rem;
    min-width: 120px;
    margin: 0;
}

.add-to-cart-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.cart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 1200px;
}

.cart-item {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    min-width: 200px;
    margin: 0;
}

.cart-item-price {
    color: #e44d26;
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 100px;
}

.cart-quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.cart-quantity-control button {
    background-color: #4CAF50;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background-color 0.3s;
}

.cart-quantity-control button:hover {
    background-color: #45a049;
}

.cart-quantity-control button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.cart-quantity-control span {
    font-size: 1.1rem;
    min-width: 30px;
    text-align: center;
}

.cart-item-total {
    font-weight: bold;
    min-width: 120px;
    text-align: right;
}

.cart-item-actions {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c82333;
}

.cart-summary {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 30px;
}

.total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e44d26;
}

.checkout-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}

.checkout-btn:hover {
    background-color: #45a049;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.empty-cart .icon {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
}

.empty-cart p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1rem;
}

.empty-cart .shop-now-btn {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.empty-cart .shop-now-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Container styles */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

#productContainer {
    width: 100%;
}

/* 消息提示样式 */
.message {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 4px;
    z-index: 1000;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: center;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.message.success {
    background-color: #4CAF50;
}

.message.success a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
    transition: opacity 0.3s;
}

.message.success a:hover {
    opacity: 0.8;
}

.message.error {
    background-color: #f44336;
}

.seller {
    color: #666;
    font-size: 0.9rem;
    min-width: 120px;
}

.cart-item-seller {
    color: #666;
    font-size: 0.9rem;
    min-width: 150px;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-control button {
    background-color: #4CAF50;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background-color 0.3s;
}

.quantity-control button:hover {
    background-color: #45a049;
}

.quantity-control button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.quantity-control input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    /* 去掉上下箭头 */
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* 兼容不同浏览器 */
.quantity-control input::-webkit-outer-spin-button,
.quantity-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-control input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 在文件末尾添加订单相关样式 */
.orders-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.order-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.order-card:hover {
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.order-header .order-id {
    font-weight: bold;
    color: #333;
}

.order-details {
    background: #f9f9f9;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.order-item:last-child {
    border-bottom: none;
}

.item-name {
    flex: 2;
    font-weight: 500;
}

.item-price {
    flex: 1;
    text-align: center;
    color: #666;
}

.item-total {
    flex: 1;
    text-align: right;
    color: #e74c3c;
    font-weight: bold;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #e74c3c;
}

.order-time {
    color: #666;
    font-size: 0.9em;
}

.status-pending {
    color: #f39c12;
    font-weight: bold;
}

.status-accepted {
    color: #27ae60;
    font-weight: bold;
}

.status-rejected {
    color: #c0392b;
    font-weight: bold;
}

.empty-orders {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.empty-orders h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
}

.empty-orders p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1rem;
}

.empty-orders a {
    display: inline-block;
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.empty-orders a:hover {
    background: #45a049;
    text-decoration: none;
}

.invalid-items-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.invalid-items-section h3 {
    color: #999;
    margin-bottom: 15px;
}

.cart-item.invalid {
    background-color: #f9f9f9;
    opacity: 0.8;
}

.invalid-reason {
    color: #dc3545;
    font-size: 0.9em;
    margin-left: 20px;
}

#checkoutBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
} 